<?
$year = $_POST['year'];
if ($year == '')
    $year = date("Y");
$month = $_POST['month'];
if ($month == '')
    $month = date("m");
$day = $_POST['day'];
if ($day == '')
    $day = date("d");
$year_month_date = $year . "-" . $month . "-" . $day;
?>